package com.fhz.module_main.adapter

import android.widget.ImageView
import com.bumptech.glide.Glide
import com.fhz.module_main.R
import com.fhz.module_main.entity.RecommendBanner
import com.zhpan.bannerview.BaseBannerAdapter
import com.zhpan.bannerview.BaseViewHolder

/**
 * 时间:2023/4/20
 * @author Mr.Feng
 * 简述: 欢迎页banner的适配器
 */
    class SimpleAdapter : BaseBannerAdapter<RecommendBanner>() {

    override fun bindData(holder: BaseViewHolder<RecommendBanner>, data: RecommendBanner?, position: Int, pageSize: Int) {
//        holder.setImageResource(R.id.banner_image, )
        val image = holder.findViewById<ImageView>(R.id.banner_image)
        Glide.with(image.context).load(data!!.imageUrl).into(image)
    }

    override fun getLayoutId(viewType: Int): Int {
        return R.layout.welcome_banner_layout
    }
}